﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace LogAnProject.Tests
{
    [TestFixture]
    class SetupTeardownTests2
    {
        LogAnalyzer mLog = null;

        [SetUp]
        public void Setup()
        {

            mLog = new LogAnalyzer();
        }

        [Test]
        public void IsValidFileName_validFileLowerCased_ReturnsTrue()
        {
            bool result = mLog.IsValidLogFileName("whatever.slf");         
            Assert.IsTrue(result, "dosya adinda hata!");
        }

        [Test]
        public void IsValidFileName_validFileUpperCased_ReturnsTrue()
        {
            bool result = mLog.IsValidLogFileName("whatever.SLF");
            Assert.IsTrue(result, "dosya adinda hata!");
        }

        [TearDown]
        public void TearDown()
        {
            mLog = null;
        }

    }
}
/*
 For unit tests, it’s important that any leftover data or instances from
previous tests are destroyed and that the state for the new test is recreated
as if no tests have been run before. If you have leftover state from
a previous test, you might find that your test fails, but only if it’s run
after a different test, and it passes other times. Locating that kind of
dependency bug between tests is difficult and time-consuming, and I
don’t recommend it to anyone.

 SETUP
   |
   V
IsValidFileName_validFileLowerCased_ReturnsTrue()
   |
   V
 TEARDOWN
   |
   V
 SETUP
   |
   V
IsValidFileName_validFileUpperCased_ReturnsTrue()
   |
   V
 TEARDOWN
 */